﻿using System.Collections.Generic;
using Pap.Data;
using Pap.Web.Utils;

namespace Pap.Web.Modules.Administration.ViewModel
{
    /// <summary>
    /// 
    /// </summary>
    public class VillagesListViewModel : IViewModel
    {
        /// <summary>
        /// 
        /// </summary>
        private IAdministrationRepository _IAdministrationRepository;

        /// <summary>
        /// Initializes a new instance of the <see cref="VillagesListViewModel"/> class.
        /// </summary>
        /// <param name="Aministration">The aministration.</param>
        public VillagesListViewModel(IAdministrationRepository Aministration)
        {
            _IAdministrationRepository = Aministration;
        }

        /// <summary>
        /// Finds the villages.
        /// </summary>
        /// <param name="VillageName">Name of the village.</param>
        /// <returns></returns>
        public IEnumerable<IVillage> FindVillages(string VillageName)
        {
            return this._IAdministrationRepository.FindVillages(V => V.VillageName.Contains(VillageName));
        }

    }
}
